{block name=report-classes}
<div class="row">
  <div class="col-sm-12">
    <a href="javascript:void(0);" onClick="exportPageToCSV($(this),$('#print-enrolments'),'enrolments.csv');" class="btn btn-info report-green"><span>Export CSV</span></a>
  </div>
</div>
<div class="row form">
  <div class="col-sm-12">
    <a href="javascript:void(0);" onClick="printArea('print-enrolments');" class="btn btn-info report-green"><span>Print</span></a>
  </div>
</div>
<div id="print-enrolments">
	{foreach $classterms as $term}
	<div class="row term">
	  <div class="col-sm-12">
	    <h2 class="title"> {$term.term_name} - {$term.term_region}<!-- {$ct.agegroup_name} | {$ct.class_start_time|date_format:"%H:%M %p"} - {$ct.class_end_time|date_format:"%H:%M %p"} | {$ct.location_suburb}, {$ct.location_state} --></h2>
	  </div>
	  <div class="col-sm-12">
	    <table class="table table-striped lblue">
	      <thead>
	        <th>Location</th>
	        <th>Class</th>
	        <th>Front-end</th>
	        <th>Front-end per.</th>
	        <th>Back-end</th>
	        <th>Back-end per.</th>
	        <th>Total Trials</th>
	      </thead>
	      <tbody>
	      {foreach $term.locations as $loc}
	        {foreach $loc.classes as $ct}
	          <tr>
	            <td>{$ct.location_name}</td>
	            <td>{$ct.class_name} - {$ct.agegroup_name}</td>
	            <td>{$ct.trialsFront}</td>
	            <td>{$ct.trialsFrontPer}%</td>
	            <td>{$ct.trialsBack}</td>
	            <td>{$ct.trialsBackPer}%</td>
	            <td>{$ct.trials}</td>
	          </tr>
	        {/foreach}
	        <tr>
            <td></td>
            <td></td>
            <td style="font-weight:bold;">{$loc.totalFront}</td>
            <td style="font-weight:bold;">{$loc.totalFrontPer}%</td>
            <td style="font-weight:bold;">{$loc.totalBack}</td>
            <td style="font-weight:bold;">{$loc.totalBackPer}%</td>
            <td style="font-weight:bold;">{$loc.total}</td>
          </tr>
	      {/foreach}
	      	<tr>
            <td></td>
            <td style="font-weight:bold;">GRAND TOTAL</td>
            <td style="font-weight:bold;">{$term.totalFront}</td>
            <td style="font-weight:bold;">{$term.totalFrontPer}%</td>
            <td style="font-weight:bold;">{$term.totalBack}</td>
            <td style="font-weight:bold;">{$term.totalBackPer}%</td>
            <td style="font-weight:bold;">{$term.total}</td>
          </tr>
	      </tbody>
	    </table>
	  </div>
	</div>
	{/foreach}
</div>
{/block} 


